package com.tree;
 
public class Main {
 
	public static void main(String[] args) {
		Merger<Integer> merger=	Math::min;

		Integer[] data=new Integer[]{1,4,7,-4,3};
		SegmentTree<Integer> tree=new SegmentTree<>(data, merger);
		System.out.println(tree);
		System.out.println(tree.query(1, 4));
		tree.set(3, 0);
		System.out.println(tree.query(1, 4));
 
	}
 
}